<template>
	<view class="page">
		<view class="aside">
			<view class="section" v-for="item in list" :key="item.id">
				<view class="left">
					<image :src="IP + item.url"></image>
				</view>
				<view class="right">
					<view>商品名称：{{item.goods.name}}</view>
					<view>所需积分：{{item.total_integral}}</view>
					<view>兑换时间：{{item.change_time}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getMyProduct} from '../../../network/me.js'
	import {IP} from '../../../network/requestUrl.js'
	export default {
		data() {
			return {
				IP,
				list: []
			};
		},
		onLoad() {
			this.init()
		},
		methods: {
			async init() {
				const result = await getMyProduct(2) 
				console.log(result)
				if (!result.flag) return
				this.list = result.data
			}
		}
	}
</script>

<style lang="scss">
.page {
	.aside {
		margin: 10px;
		.section {
			display: flex;
			background-color: white;
			padding: 10px 0;
			align-items: center;
			border-radius: 2px;
			margin: 8px 0;
			box-shadow: 0 0 2px #CCCCCC;
			.left {
				width: 70px;
				color: #1CBAB6;
				text-align: center;
				border-right: 1px dotted #F2F2F2;
				font-size: 14px;
				image {
					width: 60px;
					height: 60px;
				}
			}
			.right {
				flex: 1;
				padding-left: 15px;
			}
		}
	}
	
}
</style>
